package org.openschool.service;

import java.util.List;

import org.openschool.domain.*;
import org.openschool.dao.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class UsersServiceImpl implements UsersService {

	@Autowired
	private UsersDao usersDao;

	@Override
	@Transactional
	public void addUser(User User) {
		usersDao.addUser(User);
	}

	@Override
	@Transactional
	public List<User> listUsers() {
		return usersDao.listUsers();
	}

	@Override
	@Transactional
	public void removeUser(String username) {
		usersDao.removeUser(username);
	}

	@Override
	@Transactional
	public User getUser(String username) {
		return usersDao.getUser(username);
	}

	@Override
	public void updateUser(User user) {
		usersDao.updateUser(user);
	}
}
